// 导入组件
import Vue from 'vue';
import Router from 'vue-router';
// 登录
import login from '@/views/login';
// 首页
import index from '@/views/index';
//用户中心
import user from '@/views/xiaofang/userInfo'
//小组管理
import group from '@/views/xiaofang/group'
//设备管理
import device from '@/views/xiaofang/device'

import deviceType from '@/views/xiaofang/deviceType'
//报修管理
import repair from '@/views/xiaofang/repair'
//应急预按
import plan from '@/views/xiaofang/plan'
//救援任务
import task from '@/views/xiaofang/task'
// 启用路由
Vue.use(Router);

// 导出路由 
export default new Router({
    routes: [{
        path: '/',
        name: '',
        component: login,
        hidden: true,
        meta: {
            requireAuth: false
        }
    }, {
        path: '/login',
        name: '登录',
        component: login,
        hidden: true,
        meta: {
            requireAuth: false
        }
    }, {
        path: '/index',
        name: '首页',
        component: index,
        iconCls: 'el-icon-tickets',
        children: [
            {
                path: '/xiaofang/userInfo',
                name: '用户中心',
                component: user,
                meta: {
                    requireAuth: true
                }
            },
            {
                path: '/xiaofang/group',
                name: '小组管理',
                component: group,
                meta: {
                    requireAuth: true
                }
            },
            {
                path: '/xiaofang/device',
                name: '设备管理',
                component: device,
                meta: {
                    requireAuth: true
                }
            },
            {
                path: '/xiaofang/deviceType',
                name: '设备类别管理',
                component: deviceType,
                meta: {
                    requireAuth: true
                }
            },
            {
                path: '/xiaofang/repair',
                name: '报修管理',
                component: repair,
                meta: {
                    requireAuth: true
                }
            },
            {
                path: '/xiaofang/plan',
                name: '应急预按管理',
                component: plan,
                meta: {
                    requireAuth: true
                }
            },
            {
                path: '/xiaofang/task',
                name: '救援任务',
                component: task,
                meta: {
                    requireAuth: true
                }
            }
        ]
    }]
})